/*
 * Tencent is pleased to support the open source community by making ovCompose available.
 * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tencent.compose.sample.test

import androidx.compose.runtime.Immutable
import kotlinx.serialization.Serializable

/**
 * 测试订单数据模型
 */
@Immutable
@Serializable
data class TestOrder(
    val id: String,
    val userId: Long,
    val items: List<OrderItem>,
    val totalAmount: Double,
    val currency: String = "CNY",
    val status: OrderStatus,
    val shippingAddress: Address,
    val billingAddress: Address? = null,
    val paymentMethod: PaymentMethod,
    val createdAt: Long = System.currentTimeMillis(),
    val updatedAt: Long = System.currentTimeMillis(),
    val notes: String? = null
)

/**
 * 订单项
 */
@Immutable
@Serializable
data class OrderItem(
    val productId: String,
    val productName: String,
    val quantity: Int,
    val unitPrice: Double,
    val totalPrice: Double
)

/**
 * 订单状态枚举
 */
@Serializable
enum class OrderStatus(val displayName: String) {
    PENDING("待处理"),
    CONFIRMED("已确认"),
    PROCESSING("处理中"),
    SHIPPED("已发货"),
    DELIVERED("已送达"),
    CANCELLED("已取消"),
    REFUNDED("已退款")
}

/**
 * 地址数据模型
 */
@Immutable
@Serializable
data class Address(
    val id: String? = null,
    val recipientName: String,
    val phoneNumber: String,
    val street: String,
    val city: String,
    val state: String,
    val postalCode: String,
    val country: String = "中国",
    val isDefault: Boolean = false
)

/**
 * 支付方式枚举
 */
@Serializable
enum class PaymentMethod(val displayName: String) {
    CREDIT_CARD("信用卡"),
    DEBIT_CARD("借记卡"),
    ALIPAY("支付宝"),
    WECHAT_PAY("微信支付"),
    BANK_TRANSFER("银行转账"),
    CASH_ON_DELIVERY("货到付款")
}
